unit ActiveFormImpl1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, 
  Controls, Forms, Dialogs,ActiveX, AxCtrls, 
  ActiveFormProj1_TLB, StdVcl, StdCtrls, FileCtrl;

type
  TActiveFormX = class(TActiveForm, IActiveFormX)

    DriveBox: TDriveComboBox;
    DirBox: TDirectoryListBox;
    FileBox: TFileListBox;
    buttRun: TButton;
    buttDelete: TButton;

    Label1: TLabel;

    procedure buttDeleteClick(Sender: TObject);
    procedure buttRunClick(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
     .. .
  end;

implementation

uses ComObj, ComServ,ShellAPI;

{$R *.DFM}

{ TActiveFormX }


procedure TActiveFormX.buttDeleteClick(
                                                      Sender: TObject);
begin
   DeleteFile(FileBox.FileName);
end;

procedure TActiveFormX.buttRunClick(Sender: TObject);
begin
  ShellExecute(handle,'open',
                            PChar(FileBox.FileName),'',
                            PChar(FileBox.Directory),SW_SHOW);
end;

initialization
  TActiveFormFactory.Create(
    ComServer,
    TActiveFormControl,
    TActiveFormX,
    Class_ActiveFormX,
    1,
    '',
    OLEMISC_SIMPLEFRAME or OLEMISC_ACTSLIKELABEL,
    tmApartment);
end.
